package com.woniuxy.controller;

import com.woniuxy.pojo.Dept;
import com.woniuxy.pojo.Role;
import com.woniuxy.pojo.User;
import com.woniuxy.service.DeptService;
import com.woniuxy.service.RoleService;
import com.woniuxy.service.UserService;
import com.woniuxy.util.DateUtil;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Controller
@RequestMapping(value = "/user")
public class UserController extends BaseController{
    private Logger logger= Logger.getLogger(UserController.class);
    @Autowired
    private UserService userService;
    @GetMapping(value = "/selectAllUsers")
    @ResponseBody
    public List<User> selectAllUsers(){
        List<User> users=userService.findAllUsers();
        return users;
    }
    @RequestMapping(value = "/addUser")
    public void addUser(@RequestBody User user){
        logger.info("手机号码:"+user.getTelephone());
        logger.info("密码:"+user.getPassword());
    }
}












